﻿function CheckLogin(userName,passWrod,Valitar)
{
    if(userName=="")
    {  
       alert("温馨提示：登陆名不能为空！");
       return false;
    }else
    {
       document.getElementById("spanName").innerHTML=""; 
    }
    if(passWrod=="")
    {
       alert("温馨提示：密码不能为空！");
       return false;
    }else
    {
       document.getElementById("spanPass").innerHTML="";
    }
  SendAjax("ConMain",userName,passWrod,Valitar);
}
function SendAjax(op,Name,passWrod,Valitar)
{
    var param = "Option="+ op +"&txtLoginName="+ Name +"&txtPassword="+ passWrod+"&txtCode="+Valitar;
    var options={
        method:'post',
        parameters:param,
        onComplete:
        function(transport)
	    {
	      var retv=transport.responseText;
	      
	      if(retv=="true")
		  {
		    var url=document.referrer;
		    if(url=="")
		    {
                window.location.href="../default.aspx"; 
            }  
            else
            {
                window.location.href=url; 
            } 
		  }
		  else
		  {
		     alert(retv);
		  }
		}     

	  }
	new  Ajax.Request('../filehandle/loginform.ashx',options);
}